home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / srcuc.zip / ERRORS.H < prev    next >
Text File  |  1991-01-23  |  10KB  |  276 lines

  1. /* -*-C-*-
  2.  
  3. $Header: /scheme/users/cph/microcode/RCS/errors.h,v 9.37 1991/01/24 04:40:51 cph Exp $
  4.  
  5. Copyright (c) 1987-91 Massachusetts Institute of Technology
  6.  
  7. This material was developed by the Scheme project at the Massachusetts
  8. Institute of Technology, Department of Electrical Engineering and
  9. Computer Science.  Permission to copy this software, to redistribute
  10. it, and to use it for any purpose is granted, subject to the following
  11. restrictions and understandings.
  12.  
  13. 1. Any copy made of this software must include this copyright notice
  14. in full.
  15.  
  16. 2. Users of this software agree to make their best efforts (a) to
  17. return to the MIT Scheme project any improvements or extensions that
  18. they make, so that these may be included in future releases; and (b)
  19. to inform MIT of noteworthy uses of this software.
  20.  
  21. 3. All materials developed as a consequence of the use of this
  22. software shall duly acknowledge such use, in accordance with the usual
  23. standards of acknowledging credit in academic research.
  24.  
  25. 4. MIT has made no warrantee or representation that the operation of
  26. this software will be error-free, and MIT is under no obligation to
  27. provide any services, by way of maintenance, update, or otherwise.
  28.  
  29. 5. In conjunction with products arising from the use of this material,
  30. there shall be no use of the name of the Massachusetts Institute of
  31. Technology nor of any adaptation thereof in any advertising,
  32. promotional, or sales literature without prior written consent from
  33. MIT in each case. */
  34.  
  35. /* Error and termination code declarations. */
  36.  
  37. /* All error and termination codes must be positive
  38.  * to allow primitives to return either an error code
  39.  * or a primitive flow control value (see const.h)
  40.  */
  41.  
  42. #define ERR_BAD_ERROR_CODE            0x00
  43. #define ERR_UNBOUND_VARIABLE            0x01
  44. #define ERR_UNASSIGNED_VARIABLE            0x02
  45. #define ERR_INAPPLICABLE_OBJECT            0x03
  46. #define ERR_IN_SYSTEM_CALL            0x04
  47. /* #define ERR_ENVIRONMENT_CHAIN_TOO_DEEP    0x05 */
  48. #define ERR_BAD_FRAME                0x06
  49. #define ERR_BROKEN_COMPILED_VARIABLE        0x07
  50. #define ERR_UNDEFINED_USER_TYPE            0x08
  51. #define ERR_UNDEFINED_PRIMITIVE            0x09
  52. #define ERR_EXTERNAL_RETURN            0x0A
  53. #define ERR_EXECUTE_MANIFEST_VECTOR        0x0B
  54. #define ERR_WRONG_NUMBER_OF_ARGUMENTS        0x0C
  55. #define ERR_ARG_1_WRONG_TYPE            0x0D
  56. #define ERR_ARG_2_WRONG_TYPE            0x0E
  57. #define ERR_ARG_3_WRONG_TYPE            0x0F
  58. #define ERR_ARG_1_BAD_RANGE            0x10
  59. #define ERR_ARG_2_BAD_RANGE            0x11
  60. #define ERR_ARG_3_BAD_RANGE            0x12
  61. /* #define ERR_BAD_COMBINATION            0x13 */
  62. /* #define ERR_FASDUMP_OVERFLOW            0x14 */
  63. #define ERR_BAD_INTERRUPT_CODE            0x15 /* Not generated */
  64. /* #define ERR_NO_ERRORS            0x16 */
  65. #define ERR_FASL_FILE_TOO_BIG            0x17
  66. #define ERR_FASL_FILE_BAD_DATA            0x18
  67. #define ERR_IMPURIFY_OUT_OF_SPACE        0x19
  68.  
  69. /* The following do not exist in the 68000 version */
  70. #define ERR_WRITE_INTO_PURE_SPACE        0x1A
  71. /* #define ERR_LOSING_SPARE_HEAP        0x1B */
  72. /* #define ERR_NO_HASH_TABLE            0x1C */
  73. #define ERR_BAD_SET                             0x1D
  74. #define ERR_ARG_1_FAILED_COERCION              0x1E
  75. #define ERR_ARG_2_FAILED_COERCION              0x1F
  76. #define ERR_OUT_OF_FILE_HANDLES            0x20
  77. /* #define ERR_SHELL_DIED            0x21 */
  78.  
  79. /* Late additions to both 68000 and C world */
  80. #define ERR_ARG_4_BAD_RANGE            0x22
  81. #define ERR_ARG_5_BAD_RANGE            0x23
  82. #define ERR_ARG_6_BAD_RANGE            0x24
  83. #define ERR_ARG_7_BAD_RANGE            0x25
  84. #define ERR_ARG_8_BAD_RANGE            0x26
  85. #define ERR_ARG_9_BAD_RANGE            0x27
  86. #define ERR_ARG_10_BAD_RANGE            0x28
  87. #define ERR_ARG_4_WRONG_TYPE            0x29
  88. #define ERR_ARG_5_WRONG_TYPE            0x2A
  89. #define ERR_ARG_6_WRONG_TYPE            0x2B
  90. #define ERR_ARG_7_WRONG_TYPE            0x2C
  91. #define ERR_ARG_8_WRONG_TYPE            0x2D
  92. #define ERR_ARG_9_WRONG_TYPE            0x2E
  93. #define ERR_ARG_10_WRONG_TYPE            0x2F
  94. #define ERR_INAPPLICABLE_CONTINUATION        0x30
  95. #define ERR_COMPILED_CODE_ERROR            0x31
  96. #define ERR_FLOATING_OVERFLOW            0x32
  97. #define ERR_UNIMPLEMENTED_PRIMITIVE        0x33
  98. #define ERR_ILLEGAL_REFERENCE_TRAP        0x34
  99. #define ERR_BROKEN_VARIABLE_CACHE        0x35
  100. #define ERR_WRONG_ARITY_PRIMITIVES        0x36
  101. #define ERR_IO_ERROR                0x37
  102. #define ERR_FASDUMP_ENVIRONMENT            0x38
  103. #define ERR_FASLOAD_BAND            0x39
  104. #define ERR_FASLOAD_COMPILED_MISMATCH        0x3A
  105. #define ERR_UNKNOWN_PRIMITIVE_CONTINUATION    0x3B
  106.  
  107. /*
  108.   If you add any error codes here, add them to
  109.   the table below and to utabmd.scm as well.
  110.  */
  111.  
  112. #define MAX_ERROR                0x3B
  113.  
  114. #define ERROR_NAME_TABLE                        \
  115. {                                    \
  116. /* 0x00 */        "BAD-ERROR-CODE",                \
  117. /* 0x01 */        "UNBOUND-VARIABLE",                \
  118. /* 0x02 */        "UNASSIGNED-VARIABLE",                \
  119. /* 0x03 */        "INAPPLICABLE-OBJECT",                \
  120. /* 0x04 */        "OUT-OF-HASH-NUMBERS",                \
  121. /* 0x05 */        "ENVIRONMENT-CHAIN-TOO-DEEP",            \
  122. /* 0x06 */        "BAD-FRAME",                    \
  123. /* 0x07 */        "BROKEN-COMPILED-VARIABLE",            \
  124. /* 0x08 */        "UNDEFINED-USER-TYPE",                \
  125. /* 0x09 */        "UNDEFINED-PRIMITIVE",                \
  126. /* 0x0A */        "EXTERNAL-RETURN",                \
  127. /* 0x0B */        "EXECUTE-MANIFEST-VECTOR",            \
  128. /* 0x0C */        "WRONG-NUMBER-OF-ARGUMENTS",            \
  129. /* 0x0D */        "ARG-1-WRONG-TYPE",                \
  130. /* 0x0E */        "ARG-2-WRONG-TYPE",                \
  131. /* 0x0F */        "ARG-3-WRONG-TYPE",                \
  132. /* 0x10 */        "ARG-1-BAD-RANGE",                \
  133. /* 0x11 */        "ARG-2-BAD-RANGE",                \
  134. /* 0x12 */        "ARG-3-BAD-RANGE",                \
  135. /* 0x13 */        "BAD-COMBINATION",                \
  136. /* 0x14 */        "FASDUMP-OVERFLOW",                \
  137. /* 0x15 */        "BAD-INTERRUPT-CODE",                \
  138. /* 0x16 */        "NO-ERRORS",                    \
  139. /* 0x17 */        "FASL-FILE-TOO-BIG",                \
  140. /* 0x18 */        "FASL-FILE-BAD-DATA",                \
  141. /* 0x19 */        "IMPURIFY-OUT-OF-SPACE",            \
  142. /* 0x1A */        "WRITE-INTO-PURE-SPACE",            \
  143. /* 0x1B */        "LOSING-SPARE-HEAP",                \
  144. /* 0x1C */        "NO-HASH-TABLE",                \
  145. /* 0x1D */        "BAD-SET",                    \
  146. /* 0x1E */        "ARG-1-FAILED-COERCION",            \
  147. /* 0x1F */        "ARG-2-FAILED-COERCION",            \
  148. /* 0x20 */        "OUT-OF-FILE-HANDLES",                \
  149. /* 0x21 */        "SHELL-DIED",                    \
  150. /* 0x22 */        "ARG-4-BAD-RANGE",                \
  151. /* 0x23 */        "ARG-5-BAD-RANGE",                \
  152. /* 0x24 */        "ARG-6-BAD-RANGE",                \
  153. /* 0x25 */        "ARG-7-BAD-RANGE",                \
  154. /* 0x26 */        "ARG-8-BAD-RANGE",                \
  155. /* 0x27 */        "ARG-9-BAD-RANGE",                \
  156. /* 0x28 */        "ARG-10-BAD-RANGE",                \
  157. /* 0x29 */        "ARG-4-WRONG-TYPE",                \
  158. /* 0x2A */        "ARG-5-WRONG-TYPE",                \
  159. /* 0x2B */        "ARG-6-WRONG-TYPE",                \
  160. /* 0x2C */        "ARG-7-WRONG-TYPE",                \
  161. /* 0x2D */        "ARG-8-WRONG-TYPE",                \
  162. /* 0x2E */        "ARG-9-WRONG-TYPE",                \
  163. /* 0x2F */        "ARG-10-WRONG-TYPE",                \
  164. /* 0x30 */        "INAPPLICABLE-CONTINUATION",            \
  165. /* 0x31 */        "COMPILED-CODE-ERROR",                \
  166. /* 0x32 */        "FLOATING-OVERFLOW",                \
  167. /* 0x33 */        "UNIMPLEMENTED-PRIMITIVE",            \
  168. /* 0x34 */        "ILLEGAL-REFERENCE-TRAP",            \
  169. /* 0x35 */        "BROKEN-VARIABLE-CACHE",            \
  170. /* 0x36 */        "WRONG-ARITY-PRIMITIVES",            \
  171. /* 0x37 */        "IO-ERROR",                    \
  172. /* 0x38 */        "FASDUMP-ENVIRONMENT",                \
  173. /* 0x39 */        "FASLOAD-BAND",                    \
  174. /* 0x3A */        "FASLOAD-COMPILED-MISMATCH",            \
  175. /* 0x3B */        "UNKNOWN-PRIMITIVE-CONTINUATION"        \
  176. }
  177.  
  178. /* Termination codes: the interpreter halts on these */
  179.  
  180. #define TERM_HALT                0x00
  181. #define TERM_DISK_RESTORE            0x01
  182. #define TERM_BROKEN_HEART            0x02
  183. #define TERM_NON_POINTER_RELOCATION        0x03
  184. #define TERM_BAD_ROOT                0x04
  185. #define TERM_NON_EXISTENT_CONTINUATION        0x05
  186. #define TERM_BAD_STACK                0x06
  187. #define TERM_STACK_OVERFLOW            0x07
  188. #define TERM_STACK_ALLOCATION_FAILED        0x08
  189. #define TERM_NO_ERROR_HANDLER            0x09
  190. #define TERM_NO_INTERRUPT_HANDLER        0x0A
  191. #define TERM_UNIMPLEMENTED_CONTINUATION        0x0B
  192. #define TERM_EXIT                0x0C
  193. #define TERM_BAD_PRIMITIVE_DURING_ERROR        0x0D
  194. #define TERM_EOF                0x0E
  195. #define TERM_BAD_PRIMITIVE            0x0F
  196. #define TERM_TERM_HANDLER            0x10
  197. #define TERM_END_OF_COMPUTATION            0x11
  198. #define TERM_INVALID_TYPE_CODE                  0x12
  199. #define TERM_COMPILER_DEATH            0x13
  200. #define TERM_GC_OUT_OF_SPACE            0x14
  201. #define TERM_NO_SPACE                0x15
  202. #define TERM_SIGNAL                0x16
  203. #define TERM_TOUCH                0x17
  204. #define TERM_SAVE_AND_EXIT            0x18
  205. #define TERM_TRAP                0x19
  206. #define TERM_BAD_BACK_OUT            0x1a
  207.  
  208. /*
  209.   If you add any termination codes here, add them to
  210.   the tables below as well!
  211.  */
  212.  
  213. #define MAX_TERMINATION                0x1a
  214.  
  215. #define TERM_NAME_TABLE                            \
  216. {                                    \
  217. /* 0x00 */        "HALT",                        \
  218. /* 0x01 */        "DISK-RESTORE",                    \
  219. /* 0x02 */        "BROKEN-HEART",                    \
  220. /* 0x03 */        "NON-POINTER-RELOCATION",            \
  221. /* 0x04 */        "BAD-ROOT",                    \
  222. /* 0x05 */        "NON-EXISTENT-CONTINUATION",            \
  223. /* 0x06 */        "BAD-STACK",                    \
  224. /* 0x07 */        "STACK-OVERFLOW",                \
  225. /* 0x08 */        "STACK-ALLOCATION-FAILED",            \
  226. /* 0x09 */        "NO-ERROR-HANDLER",                \
  227. /* 0x0A */        "NO-INTERRUPT-HANDLER",                \
  228. /* 0x0B */        "UNIMPLEMENTED-CONTINUATION",            \
  229. /* 0x0C */        "EXIT",                        \
  230. /* 0x0D */        "BAD-PRIMITIVE-DURING-ERROR",            \
  231. /* 0x0E */        "EOF",                        \
  232. /* 0x0F */        "BAD-PRIMITIVE",                \
  233. /* 0x10 */        "HANDLER",                    \
  234. /* 0x11 */        "END-OF-COMPUTATION",                \
  235. /* 0x12 */        "INVALID-TYPE-CODE",                \
  236. /* 0x13 */        "COMPILER-DEATH",                \
  237. /* 0x14 */        "GC-OUT-OF-SPACE",                \
  238. /* 0x15 */        "NO-SPACE",                    \
  239. /* 0x16 */        "SIGNAL",                    \
  240. /* 0x17 */        "TOUCH",                    \
  241. /* 0x18 */        "SAVE-AND-EXIT",                \
  242. /* 0x19 */        "TERM_TRAP",                    \
  243. /* 0x1a */        "BAD_BACK_OUT"                    \
  244. }
  245.  
  246. #define TERM_MESSAGE_TABLE                        \
  247. {                                    \
  248. /* 0x00 */        "Moriturus te saluto",                \
  249. /* 0x01 */        "Unrecoverable error while loading a band",    \
  250. /* 0x02 */        "Broken heart encountered",            \
  251. /* 0x03 */        "Non pointer relocation",            \
  252. /* 0x04 */        "Cannot restore control state from band",    \
  253. /* 0x05 */        "Nonexistent return code",            \
  254. /* 0x06 */        "Control stack messed up",            \
  255. /* 0x07 */        "Stack overflow: Maximum recursion depth exceeded", \
  256. /* 0x08 */        "Not enough space for stack!",            \
  257. /* 0x09 */        "No error handler",                \
  258. /* 0x0A */        "No interrupt handler",                \
  259. /* 0x0B */        "Unimplemented return code",            \
  260. /* 0x0C */        "Inconsistency detected",            \
  261. /* 0x0D */        "Error during unknown primitive",        \
  262. /* 0x0E */        "End of input stream reached",            \
  263. /* 0x0F */        "Bad primitive invoked",            \
  264. /* 0x10 */        "Termination handler returned",            \
  265. /* 0x11 */        "End of computation",                \
  266. /* 0x12 */        "Unknown type encountered",            \
  267. /* 0x13 */        "Mismatch between compiled code and compiled code support", \
  268. /* 0x14 */        "Out of space after garbage collection",    \
  269. /* 0x15 */        "Out of memory: Available memory exceeded",    \
  270. /* 0x16 */        "Unhandled signal received",            \
  271. /* 0x17 */        "Touch without futures support",        \
  272. /* 0x18 */        "Halt requested by external source",        \
  273. /* 0x19 */        "User requested termination after trap",    \
  274. /* 0x1a */        "Backing out of non-primitive"            \
  275. }
  276.